package com.etime.perfectschool.controller;

import com.etime.perfectschool.pojo.ActiviesComments;
import com.etime.perfectschool.pojo.FoodComments;
import com.etime.perfectschool.service.ActiviesCommentsService;
import com.etime.perfectschool.service.FoodCommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class FoodCommentsController {
    @Autowired
    private FoodCommentsService foodCommentsService;
    //评论
    @PostMapping("/addFoodComments")
    public int addFoodComments(FoodComments foodComments)
    {
        return  foodCommentsService.addFoodComments(foodComments);
    }
    //    删除某条活动的全部评论
    @DeleteMapping("/deleteFoodCommentsByfoodId")
    public boolean deleteFoodCommentsByfoodId(int foodId)
    {
        return foodCommentsService.deleteFoodCommentsByfoodId(foodId);
    }
}
